package com.smitish.vueblog.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.smitish.vueblog.entity.Blog;
import com.smitish.vueblog.mapper.BlogMapper;
import com.smitish.vueblog.service.BlogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.smitish.vueblog.vo.BlogUserVO;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author Smitish
 * @since 2020-11-30
 */
@Service
public class BlogServiceImpl extends ServiceImpl<BlogMapper, Blog> implements BlogService {

    /**
     * 调用Mapper里面的Sql语句实现自定义的Sql查询
     *
     * @param page 页码
     * @return 页码对象
     */
    @Override
    public Page<BlogUserVO> getBlogUser(Page<BlogUserVO> page) {
        return page.setRecords(this.baseMapper.getBlogUser(page));
    }

    @Override
    public Page<BlogUserVO> getUnknownBlog(String content, Page<BlogUserVO> page) {
//        List<Blog> unknownBlog = this.baseMapper.getUnknownBlog(content ,page);
        return page.setRecords(this.baseMapper.getUnknownBlog(content ,page));
    }

}
